package cn.dakaqi.entities;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by chunyang on 2016/4/29.
 */
@Entity
@Table(name = "U_INDEX_DATA")
public class IndexData extends IdEntity
{
    private static final long serialVersionUID = -2279706391831730424L;
    private String type;    //分类,
    private int delStatus;//是否被删除
    private int top;//是否被置顶
    private Date createTime;//创建日期
    private int display;//是否显示
    private String city;    //招募的地点
    private String job;    //招募所需的职业
    private String serviceField;    //招募的服务领域,
    private String skill;    //招募所需的个人技能
    private SysTopic sysTopic;
    private ActivityRecruit activityRecruit;
    private GroupRecruit groupRecruit;
    private Date stopTime;
    private int stopStatus;

    public IndexData(Long id)
    {
        this.id = id;
    }

    public IndexData()
    {
    }

    public int getStopStatus()
    {
        return stopStatus;
    }

    public void setStopStatus(int stopStatus)
    {
        this.stopStatus = stopStatus;
    }

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getStopTime()
    {
        return stopTime;
    }

    public void setStopTime(Date stopTime)
    {
        this.stopTime = stopTime;
    }

    public String getCity()
    {
        return city;
    }

    public void setCity(String city)
    {
        this.city = city;
    }

    public String getJob()
    {
        return job;
    }

    public void setJob(String job)
    {
        this.job = job;
    }

    public String getServiceField()
    {
        return serviceField;
    }

    public void setServiceField(String serviceField)
    {
        this.serviceField = serviceField;
    }

    public String getSkill()
    {
        return skill;
    }

    public void setSkill(String skill)
    {
        this.skill = skill;
    }

    public String getType()
    {
        return type;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public int getDelStatus()
    {
        return delStatus;
    }

    public void setDelStatus(int delStatus)
    {
        this.delStatus = delStatus;
    }

    public int getTop()
    {
        return top;
    }

    public void setTop(int top)
    {
        this.top = top;
    }

    // 设定JSON序列化时的日期格式
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCreateTime()
    {
        return createTime;
    }

    public void setCreateTime(Date createTime)
    {
        this.createTime = createTime;
    }

    public int getDisplay()
    {
        return display;
    }

    public void setDisplay(int display)
    {
        this.display = display;
    }

    @JsonIgnore
    @OneToOne
    @JoinColumn(name = "SYS_TOPIC_ID")
    public SysTopic getSysTopic()
    {
        return sysTopic;
    }

    public void setSysTopic(SysTopic sysTopic)
    {
        this.sysTopic = sysTopic;
    }

    @JsonIgnore
    @OneToOne
    @JoinColumn(name = "ACTIVITY_RECRUIT_ID")
    public ActivityRecruit getActivityRecruit()
    {
        return activityRecruit;
    }

    public void setActivityRecruit(ActivityRecruit activityRecruit)
    {
        this.activityRecruit = activityRecruit;
    }

    @JsonIgnore
    @OneToOne
    @JoinColumn(name = "GROUP_RECRUIT_ID")
    public GroupRecruit getGroupRecruit()
    {
        return groupRecruit;
    }

    public void setGroupRecruit(GroupRecruit groupRecruit)
    {
        this.groupRecruit = groupRecruit;
    }
}
